package com.itheima.stock.config;


import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
import org.springframework.security.crypto.password.PasswordEncoder;

/**
 * PasswordEncoderConfiguration
 *
 * @author DanLi
 * @date 2025/7/13
 * 密码加密配置类
 */
@Configuration
public class PasswordEncoderConfiguration {

    /**
     * 将PasswordEncoder放入spring IOC容器
     * @return 加密后的密码
     */
    @Bean
    public PasswordEncoder passwordEncoder(){
        return new BCryptPasswordEncoder();
    }
}
